<div class="row justify-content-center">
    <div class="col-8">
        <form name="editForm" role="form" novalidate (ngSubmit)="save()" #editForm="ngForm">
            <h2 id="jhi-category-heading" jhiTranslate="contractApp.category.home.createOrEditLabel">Create or edit a Category</h2>
            <div>
                <jhi-alert-error></jhi-alert-error>
                <div class="form-group" [hidden]="!category.id">
                    <label for="id" jhiTranslate="global.field.id">ID</label>
                    <input type="text" class="form-control" id="id" name="id"
                        [(ngModel)]="category.id" readonly />
                </div>
                <div class="form-group">
                    <label class="form-control-label" jhiTranslate="contractApp.category.name" for="field_name">Name</label>
                    <input type="text" class="form-control" name="name" id="field_name"
                        [(ngModel)]="category.name" />
                </div>
                <div class="form-group">
                    <label class="form-control-label" jhiTranslate="contractApp.category.prefix" for="field_prefix">Prefix</label>
                    <input type="text" class="form-control" name="prefix" id="field_prefix"
                        [(ngModel)]="category.prefix" />
                </div>
                <div class="form-group">
                    <label class="form-control-label" jhiTranslate="contractApp.category.createdDate" for="field_createdDate">Created Date</label>
                    <div class="input-group">
                        <input id="field_createdDate" type="text" class="form-control" name="createdDate" ngbDatepicker  #createdDateDp="ngbDatepicker" [(ngModel)]="category.createdDate"
                        />
                        <span class="input-group-append">
                            <button type="button" class="btn btn-secondary" (click)="createdDateDp.toggle()"><fa-icon [icon]="'calendar-alt'"></fa-icon></button>
                        </span>
                    </div>
                </div>

                <div class="form-group">
                    <label class="form-control-label" jhiTranslate="contractApp.category.creator" for="field_creator">Creator</label>
                    <select class="form-control" id="field_creator" name="creator" [(ngModel)]="category.creator" >
                        <option [ngValue]="null"></option>
                        <option [ngValue]="userOption.id === category.creator?.id ? category.creator : userOption" *ngFor="let userOption of users; trackBy: trackUserById">{{userOption.login}}</option>
                    </select>
                </div>
            </div>
            <div>
                <button type="button" id="cancel-save" class="btn btn-secondary"  (click)="previousState()">
                    <fa-icon [icon]="'ban'"></fa-icon>&nbsp;<span jhiTranslate="entity.action.cancel">Cancel</span>
                </button>
                <button type="submit" id="save-entity" [disabled]="editForm.form.invalid || isSaving" class="btn btn-primary">
                    <fa-icon [icon]="'save'"></fa-icon>&nbsp;<span jhiTranslate="entity.action.save">Save</span>
                </button>
            </div>
        </form>
    </div>
</div>
